package com.hulk.provider.run;

/**	
 * <br>
 * Copyright 2014 om.All rights reserved.<br>
 * <br>			 
 * Package:  <br>
 * FileName: Main.java <br>
 * <br>
 * @version
 * @author Liuxingwen
 * @created 2016年8月8日
 * @last Modified 
 * @history
 */

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 *  {该处说明该构造函数的含义及作用}
 *  @author Liuxingwen
 *  @created 2016年8月8日 下午5:08:51
 *  @lastModified       
 *  @history           
 */
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.hulk.service.HelloWorldService;

public class Provider {
	@SuppressWarnings({ "rawtypes" })
	public static void main(String[] args) throws Exception {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
				new String[] { "provider-regist.xml", "applicationContext.xml" });
		context.start();
		testServer(context);
		BlockingQueue queue = new ArrayBlockingQueue(10);
		queue.take();
		// System.in.read(); // 为保证服务一直开着，利用输入流的阻塞来模拟
	}

	private static void testServer(ClassPathXmlApplicationContext context) {
		HelloWorldService iHelloWorldService = (HelloWorldService) context
				.getBean("helloWorldService");
		System.out.println(iHelloWorldService
				.hello("hello provider==========="));

	}
}